From 0cea3e3d290cda9fe72a006071db86d1c2383cbb Mon Sep 17 00:00:00 2001 From: "kaf24@labyrinth.cl.cam.ac.uk" Date: Thu, 26 Aug 2004 15:53:08 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.108 (412e0764N-PIybRvZOXrgV9F-pj5nQ) Add a 'domid' field to device-interface status messages, informing the front end of the identity of the backend to which it is connecting. --- tools/python/xen/lowlevel/xu/xu.c | 2 ++ tools/python/xen/xend/server/blkif.py | 2 ++ tools/python/xen/xend/server/netif.py | 2 ++ xen/include/hypervisor-ifs/io/domain_controller.h | 6 ++++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/lowlevel/xu/xu.c b/tools/python/xen/lowlevel/xu/xu.c index 344cb8cc4b..c1c171383e 100644 --- a/tools/python/xen/lowlevel/xu/xu.c +++ b/tools/python/xen/lowlevel/xu/xu.c @@ -547,6 +547,7 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args) P2C(blkif_fe_interface_status_changed_t, handle, u32); P2C(blkif_fe_interface_status_changed_t, status, u32); P2C(blkif_fe_interface_status_changed_t, evtchn, u16); + P2C(blkif_fe_interface_status_changed_t, domid, u16); break; case TYPE(CMSG_BLKIF_BE, CMSG_BLKIF_BE_CREATE): P2C(blkif_be_create_t, domid, u32); @@ -594,6 +595,7 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args) P2C(netif_fe_interface_status_changed_t, handle, u32); P2C(netif_fe_interface_status_changed_t, status, u32); P2C(netif_fe_interface_status_changed_t, evtchn, u16); + P2C(netif_fe_interface_status_changed_t, domid, u16); P2C(netif_fe_interface_status_changed_t, mac[0], u8); P2C(netif_fe_interface_status_changed_t, mac[1], u8); P2C(netif_fe_interface_status_changed_t, mac[2], u8); diff --git a/tools/python/xen/xend/server/blkif.py b/tools/python/xen/xend/server/blkif.py index 00f19a805d..0a021b1777 100755 --- a/tools/python/xen/xend/server/blkif.py +++ b/tools/python/xen/xend/server/blkif.py @@ -121,6 +121,7 @@ class BlkifBackendController(controller.BackendController): msg = packMsg('blkif_fe_interface_status_changed_t', { 'handle' : self.handle, 'status' : BLKIF_INTERFACE_STATUS_CONNECTED, + 'domid' : 0, ## FIXME: should be domid of backend 'evtchn' : self.evtchn['port2'] }) self.controller.writeRequest(msg, response=response) @@ -382,6 +383,7 @@ class BlkifController(controller.SplitController): msg = packMsg('blkif_fe_interface_status_changed_t', { 'handle' : 0, 'status' : BLKIF_INTERFACE_STATUS_DISCONNECTED, + 'domid' : 0, ## FIXME: should be domid of backend 'evtchn' : 0 }) self.writeRequest(msg) diff --git a/tools/python/xen/xend/server/netif.py b/tools/python/xen/xend/server/netif.py index 864f6ebd2d..1ba2169878 100755 --- a/tools/python/xen/xend/server/netif.py +++ b/tools/python/xen/xend/server/netif.py @@ -234,6 +234,7 @@ class NetDev(controller.SplitDev): { 'handle' : self.vif, 'status' : NETIF_INTERFACE_STATUS_CONNECTED, 'evtchn' : self.evtchn['port2'], + 'domid' : 0, ## FIXME: should be domid of backend 'mac' : self.mac }) self.controller.writeRequest(msg) @@ -242,6 +243,7 @@ class NetDev(controller.SplitDev): { 'handle' : self.vif, 'status' : NETIF_INTERFACE_STATUS_DISCONNECTED, 'evtchn' : 0, + 'domid' : 0, ## FIXME: should be domid of backend 'mac' : self.mac }) self.controller.writeRequest(msg) diff --git a/xen/include/hypervisor-ifs/io/domain_controller.h b/xen/include/hypervisor-ifs/io/domain_controller.h index 37dbd34db4..a7f3e4ee08 100644 --- a/xen/include/hypervisor-ifs/io/domain_controller.h +++ b/xen/include/hypervisor-ifs/io/domain_controller.h @@ -96,7 +96,8 @@ typedef struct { u32 handle; /* 0 */ u32 status; /* 4 */ u16 evtchn; /* 8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */ -} PACKED blkif_fe_interface_status_changed_t; /* 10 bytes */ + domid_t domid; /* 10: status != BLKIF_INTERFACE_STATUS_DESTROYED */ +} PACKED blkif_fe_interface_status_changed_t; /* 12 bytes */ /* * CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED: @@ -347,7 +348,8 @@ typedef struct { u32 status; /* 4 */ u16 evtchn; /* 8: status == NETIF_INTERFACE_STATUS_CONNECTED */ u8 mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */ -} PACKED netif_fe_interface_status_changed_t; /* 16 bytes */ + domid_t domid; /* 16: status != NETIF_INTERFACE_STATUS_DESTROYED */ +} PACKED netif_fe_interface_status_changed_t; /* 18 bytes */ /* * CMSG_NETIF_FE_DRIVER_STATUS_CHANGED: -- 2.30.2